﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:converters="clr-namespace:EyeSoft.Wpf.Facilities.Converters;assembly=EyeSoft.Wpf.Facilities"
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit">
	<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary>
			<converters:ErrorConverter x:Key="ErrorConverter" />
		</ResourceDictionary>
	</ResourceDictionary.MergedDictionaries>
	<Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}">
		<Setter Property="VerticalContentAlignment" Value="Center"/>
	</Style>
	<Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}">
		<Setter Property="Height" Value="30"/>
		<Setter Property="Margin" Value="5"/>
		<Setter Property="VerticalAlignment" Value="Center"/>
	</Style>
	<Style x:Key="{x:Type DatePicker}" TargetType="{x:Type DatePicker}">
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="Height" Value="30"/>
	</Style>
	<Style TargetType="{x:Type controls:AutoCompleteBox}">
		<Setter Property="Height" Value="30"/>
		<Setter Property="Padding" Value="3"/>
		<Setter Property="Margin" Value="3"/>
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Margin" Value="0, 2, 40, 2" />
		<Setter Property="Validation.ErrorTemplate">
			<Setter.Value>
				<ControlTemplate>
					<DockPanel LastChildFill="true">
						<Border
							Background="Red"
							DockPanel.Dock="right"
							Margin="5,0,0,0"
							Width="15"
							Height="15"
							CornerRadius="10"
							ToolTip="{Binding ElementName=customAdorner, Converter={StaticResource ErrorConverter},	Path=AdornedElement.(Validation.Errors)}">
							<TextBlock
								Text="!"
								VerticalAlignment="Center"
								HorizontalAlignment="Center"
								FontWeight="Bold"
								Foreground="white"
							/>
						</Border>
						<AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
							<Border BorderBrush="red" BorderThickness="1" />
						</AdornedElementPlaceholder>
					</DockPanel>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style TargetType="{x:Type TextBox}">
		<Setter Property="CharacterCasing" Value="Upper"/>
		<Setter Property="Height" Value="30"/>
		<Setter Property="Padding" Value="3"/>
		<Setter Property="Margin" Value="0, 2, 40, 2" />
		<Setter Property="VerticalContentAlignment" Value="Center"/>
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Validation.ErrorTemplate">
			<Setter.Value>
				<ControlTemplate>
					<DockPanel LastChildFill="true">
						<Border
							Background="Red"
							DockPanel.Dock="right"
							Margin="5,0,0,0"
							Width="15"
							Height="15"
							CornerRadius="10"
							ToolTip="{Binding ElementName=customAdorner, Converter={StaticResource ErrorConverter},	Path=AdornedElement.(Validation.Errors)}">
							<TextBlock
								Text="!"
								VerticalAlignment="Center"
								HorizontalAlignment="Center"
								FontWeight="Bold"
								Foreground="white"
							/>
						</Border>
						<AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center" >
							<Border BorderBrush="red" BorderThickness="1" />
						</AdornedElementPlaceholder>
					</DockPanel>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>